/*     */ package com.zimbra.cs.mime;
/*     */ 
/*     */ import com.zimbra.common.mime.ContentType;
/*     */ import java.util.List;
/*     */ import javax.mail.MessagingException;
/*     */ import javax.mail.internet.MimePart;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class MPartInfo
/*     */ {
/*     */   MimePart mPart;
/*     */   MPartInfo mParent;
/*     */   List<MPartInfo> mChildren;
/*     */   String mPartName;
/*     */   String mContentType;
/*     */   String mDisposition;
/*     */   String mFilename;
/*     */   int mPartNum;
/*     */   int mSize;
/*     */   boolean mIsFilterableAttachment;
/*     */   boolean mIsToplevelAttachment;
/*     */   
/*     */   public String toString()
/*     */   {
/*  45 */     StringBuilder sb = new StringBuilder();
/*  46 */     sb.append("MPartInfo: {");
/*  47 */     sb.append("partName: ").append(this.mPartName).append(", ");
/*  48 */     sb.append("contentType: ").append(this.mContentType).append(", ");
/*  49 */     sb.append("size: ").append(this.mSize).append(", ");
/*  50 */     sb.append("disposition: ").append(this.mDisposition).append(", ");
/*  51 */     sb.append("filename: ").append(this.mFilename).append(", ");
/*  52 */     sb.append("partNum: ").append(this.mPartNum).append(", ");
/*  53 */     sb.append("isFilterableAttachment: ").append(this.mIsFilterableAttachment);
/*  54 */     sb.append("isToplevelAttachment: ").append(this.mIsToplevelAttachment);
/*  55 */     sb.append("}");
/*  56 */     return sb.toString();
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public boolean isFilterableAttachment()
/*     */   {
/*  68 */     return this.mIsFilterableAttachment;
/*     */   }
/*     */   
/*     */   public boolean isTopLevelAttachment() {
/*  72 */     return this.mIsToplevelAttachment;
/*     */   }
/*     */   
/*     */   public MimePart getMimePart() {
/*  76 */     return this.mPart;
/*     */   }
/*     */   
/*     */   public MPartInfo getParent() {
/*  80 */     return this.mParent;
/*     */   }
/*     */   
/*     */   public boolean hasChildren() {
/*  84 */     return (this.mChildren != null) && (!this.mChildren.isEmpty());
/*     */   }
/*     */   
/*     */   public List<MPartInfo> getChildren() {
/*  88 */     return this.mChildren;
/*     */   }
/*     */   
/*     */   public String getPartName() {
/*  92 */     return this.mPartName;
/*     */   }
/*     */   
/*     */   public int getPartNum() {
/*  96 */     return this.mPartNum;
/*     */   }
/*     */   
/*     */   public int getSize() {
/* 100 */     return this.mSize;
/*     */   }
/*     */   
/*     */   public String getContentType() {
/* 104 */     return this.mContentType;
/*     */   }
/*     */   
/*     */   public boolean isMultipart() {
/* 108 */     return this.mContentType.startsWith("multipart/");
/*     */   }
/*     */   
/*     */   public boolean isMessage() {
/* 112 */     return this.mContentType.equals("message/rfc822");
/*     */   }
/*     */   
/*     */   public String getContentTypeParameter(String name) {
/*     */     try {
/* 117 */       return new ContentType(this.mPart.getContentType()).getParameter(name);
/*     */     } catch (MessagingException e) {}
/* 119 */     return null;
/*     */   }
/*     */   
/*     */   public String getContentID()
/*     */   {
/*     */     try {
/* 125 */       return this.mPart.getContentID();
/*     */     } catch (MessagingException me) {}
/* 127 */     return null;
/*     */   }
/*     */   
/*     */   public String getDisposition()
/*     */   {
/* 132 */     return this.mDisposition;
/*     */   }
/*     */   
/*     */   public String getFilename() {
/* 136 */     return this.mFilename;
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/mime/MPartInfo.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */